<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>栏目管理</title>
	<meta name="decorator" content="default"/>
	<link href="${ctxStatic}/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
	<%@include file="/WEB-INF/views/include/treetable.jsp" %>
	<script type="text/javascript">
        $(document).ready(function() {
            $("#treeTable").treeTable({expandLevel : 3});
        });
	</script>

</head>
<body>

<div class="wrapper wrapper-content">
	<div class="col-sm-12">
		<div class="ibox float-e-margins">
			<div class="ibox-title">
				<h5>创建栏目</h5>
			</div>
			<div class="ibox-content">
				<form:form id="inputForm" modelAttribute="category" action="${ctx}/cms/category/save" method="post" class="form-horizontal">
					<form:hidden path="id"/>
					<div class="form-group">
						<label class="col-sm-3 control-label">上级栏目：</label>
						<input type="hidden" name ="office.id" value="1">
						<input type="hidden" name="office.name" value="一级栏目">
						<div class="col-sm-8">
							<sys:treeselect id="category"  name="parent.id" value="${category.parent.id}" labelName="parent.name" labelValue="${category.parent.name}"
											title="栏目" url="/cms/category/treeData" extId="${category.id}" cssClass="form-control"/>
						</div>
					</div>

					<div class="form-group">
						<label class="col-sm-3 control-label">栏目名称：</label>
						<div class="col-sm-8">
							<form:input path="name"  maxlength="50" class="form-control" required="true"  placeholder="请输入栏目名称" />
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group" style="margin-top: 30px">
						<div class="col-sm-8 col-sm-offset-3">
							<button class="btn btn-w-m btn-primary" type="submit">保存</button>
							<c:if test="${category.id!=null}">
								<button  class="btn btn-w-m btn-white" onclick="history.go(-1)">取消</button>
							</c:if>
						</div>
					</div>
				</form:form>
			</div>
		</div>
	</div>
</div>
<script src="${ctxStatic}/js/plugins/validate/jquery.validate.min.js"></script>
<script src="${ctxStatic}/js/plugins/validate/messages_zh.min.js"></script>
<script src="${ctxStatic}/js/idenger.form.js"></script>
</body>
</html>